<template>
<div class="duizhang">

  <h2>交易流水查询</h2>

  <div style="width: 1400px;margin-left: 50px">

  <el-form :model="form" :inline="true">
    <el-form-item label="交易流水号">
      <el-input v-model="form.orderNo" clearable></el-input>
    </el-form-item>
    <el-form-item label="业务订单号">
      <el-input v-model="form.businessOrderPlanNo" clearable></el-input>
    </el-form-item>
    <el-form-item label="交易账户类型">
      <el-select v-model="form.tradeAccountType" clearable>
        <el-option label="微信" value="1"></el-option>
        <el-option label="支付宝" value="2"></el-option>
        <el-option label="银行卡" value="3"></el-option>
        <el-option label="拉卡拉" value="4"></el-option>
      </el-select>
    </el-form-item>
    <el-form-item label="用户类型">
      <el-select v-model="form.userType" clearable>
        <el-option label="个人用户" value="1"></el-option>
        <el-option label="企业用户" value="2"></el-option>
      </el-select>
    </el-form-item>
    <el-form-item>
      <el-button type="warning" @click="initData()">查询</el-button>
    </el-form-item>
  </el-form>

    <el-table
      :data="tableData"
      style="border: 1px solid black">
      <el-table-column
        prop="orderNo"
        label="交易流水号"
        width="180">
      </el-table-column>
      <el-table-column
        prop="businessOrderPlanNo"
        label="业务订单号"
        width="180">
      </el-table-column>
      <el-table-column
        label="交易账户类型">
        <template slot-scope="scope">
          <span v-if="scope.row.tradeAccountType == 1">微信</span>
          <span v-if="scope.row.tradeAccountType == 2">支付宝</span>
          <span v-if="scope.row.tradeAccountType == 3">银行卡</span>
          <span v-if="scope.row.tradeAccountType == 4">拉卡拉</span>
        </template>
      </el-table-column>
      <el-table-column
        label="用户类型">
        <template slot-scope="scope">
          <span v-if="scope.row.userType == 1">个人用户</span>
          <span v-if="scope.row.userType == 2">企业用户</span>
        </template>
      </el-table-column>
      <el-table-column
        prop="tradeAccountNo"
        label="交易账号">
      </el-table-column>
      <el-table-column
        prop="tradeAccount"
        label="交易账户">
      </el-table-column>
      <el-table-column
        label="支付方式">
        <template slot-scope="scope">
          <span v-if="scope.row.payWay == 1">微信扫码</span>
          <span v-if="scope.row.payWay == 2">支付宝扫码</span>
        </template>
      </el-table-column>
      <el-table-column
        prop="finalAmount"
        label="结算金额">
      </el-table-column>
      <el-table-column
        prop="tradeUser"
        label="交易对手">
      </el-table-column>
      <el-table-column
        prop="dsAccount"
        label="对手账号">
      </el-table-column>
      <el-table-column
        prop="tradeQudao"
        label="交易渠道">
      </el-table-column>
      <el-table-column
        prop="qudaoOrderNo"
        label="渠道订单号">
      </el-table-column>
      <el-table-column
        label="交易结果">
        <template slot-scope="scope">
          <span v-if="scope.row.tradeResult == 1">处理中</span>
          <span v-if="scope.row.tradeResult == 2">成功</span>
          <span v-if="scope.row.tradeResult == 3">失败</span>
        </template>
      </el-table-column>
      <el-table-column
        prop="returnCode"
        label="返回码">
      </el-table-column>
      <el-table-column
        prop="returnMsg"
        label="返回信息">
      </el-table-column>
      <el-table-column
        prop="tradeDateFq"
        label="发起交易日期">
      </el-table-column>
      <el-table-column
        prop="tradeDateZx"
        label="执行交易日期">
      </el-table-column>
      <el-table-column
        prop="tradeDateJz"
        label="支付截至日期">
      </el-table-column>
      <el-table-column
        prop="tradeRate"
        label="费率">
      </el-table-column>
      <el-table-column
        prop="commissionFee"
        label="手续费">
      </el-table-column>
      <el-table-column
        prop="amount"
        label="订单金额">
      </el-table-column>
      <el-table-column
        prop="payAmount"
        label="支付金额">
      </el-table-column>
    </el-table>

    <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="current"
      :page-sizes="sizes"
      :page-size="size"
      layout="total, sizes, prev, pager, next, jumper"
      :total="total">
    </el-pagination>
  </div>

</div>
</template>

<script>
import {allList} from "@/api/wishu/jiaoyi";

export default {
  name: "jiaoyi",
  data(){
    return{
      form:{},
      tableData:[],
      current:1,
      sizes:[2,3,5,10],
      size:5,
      total:0,
    }
  },
  created() {
    this.initData();
  },
  methods:{
    initData(){
      allList(this.current,this.size,this.form).then((res)=>{
        this.tableData=res.records;
        this.total=res.total;
      })
    },
    handleSizeChange(val) {
      this.size=val;
      this.initData();
    },
    handleCurrentChange(val) {
      this.current=val;
      this.initData();
    }
  }
}
</script>

<style scoped>

</style>
